//headers 
#include<algorithm>
#include<cassert>
#include<cstdio>
#include<deque>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<deque>
#include<set>
#include<string>
#include<sstream>
#include<stack>
#include<streambuf>
#include<vector>
using namespace std;

//macros
#define LET(x,a) typeof(a) x(a)
#define FOR(i,a,n) for(LET(i,a);i!=n;i++)
#define REP(i,n) FOR(i,0,n)
#define sz size()
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define dbge(x) cout<<#x<<"->"<<x<<endl;
#define PRINT(x) REP(i,x.sz) dbge(x[i]);
#define OUT(x) x<<" "
#define LL long long 
#define VI vector<int>
#define VS vector<string>
const int INF = (int) 1e8;

//code of suren
map<int,LL> arr;

LL go(int n){
  //  if( arr.find(n) != arr.end() ) return arr[n] ;
  if ( n == 1 ) return 1;
  if( n%2 ) return ( go(3*n+1) + 1 );
  else return ( go(n/2) + 1 );
}

int main(){
  int a,b;
  //arr[1]=1;
  while(cin>>a>>b){
    int ta=a,tb=b;
    if(a>b) swap(a,b);

    LL max=0;

    FOR(i,a,b+1) { LL temp=go(i); if(temp>max) max=temp; }

    cout<<OUT(ta)<<OUT(tb)<<max<<endl;
  }  
  return 0;
}

